﻿using System;

using PortalIntranet.DatabaseComponents.WebParts;
using PortalIntranet.DatabaseComponents;

namespace PortalIntranet.ObjectComponents.WebParts
{
	public abstract class WebPartBaseInfo : IWebPart
	{
		public WebPartBaseInfo(WebPart webpart)
		{
			this.Id = webpart.Id;
			this.Nome = webpart.Nome;
			this.Linha = webpart.Linha;
			this.Coluna = webpart.Coluna;
			this.Ordem = webpart.Ordem;
			this.PermitirMinimizar = webpart.PermitirMinimizar;
			this.ExibirCabecalho = webpart.ExibirCabecalho;
			this.ExibirBordas = webpart.ExibirBordas;
			this.TipoWebPart = webpart.TipoWebPart;
			this.Cor = webpart.Cor;
			this.Altura = webpart.Altura;
		}

		public int Id { get; set; }

		public string Nome { get; set; }

		public LinhaPortlet Linha { get; set; }

		public int Coluna { get; set; }

		public int Ordem { get; set; }

		public bool PermitirMinimizar { get; set; }

		public bool ExibirCabecalho { get; set; }

		public bool ExibirBordas { get; set; }

		public TipoWebPart TipoWebPart { get; set; }

		public CorWebPart Cor { get; set; }

		public int Altura { get; set; }

		public string PartialView
		{
			get
			{
				switch (this.TipoWebPart)
				{
					case TipoWebPart.Aniversariantes:
						return "../WebParts/Aniversariantes";
					case TipoWebPart.Biblioteca:
						break;
					case TipoWebPart.ConteudoHtml:
						return "../WebParts/ConteudosHtml";
					case TipoWebPart.ConteudoWeb:
						return "../WebParts/ConteudosWeb";
					case TipoWebPart.Customizavel:
						break;
					case TipoWebPart.Enquetes:
						break;
					case TipoWebPart.Eventos:
						break;
					case TipoWebPart.Formularios:
						break;
					case TipoWebPart.ForunsDiscussao:
						break;
					case TipoWebPart.Galerias:
						return "../WebParts/Galerias";
					case TipoWebPart.LinksGerais:
						return "../WebParts/LinksGerais";
					case TipoWebPart.Listas:
						break;
					case TipoWebPart.Noticias:
						break;
					case TipoWebPart.Ramais:
						return "../WebParts/Ramais";
					case TipoWebPart.Relatorios:
						break;
					case TipoWebPart.Reunioes:
						break;
					case TipoWebPart.TabelasDinamicas:
						break;
					default:
						break;
				}

				return "about:blank";
			}
		}
	}
}
